﻿using System;
using Styx.Plugins;
using Styx.Common;
using System.IO;

namespace LevelingHelper
{
    public class Main : HBPlugin
    {

        public override string Author { get { return "toNyx"; } }
        public override string Name { get { return "LevelingHelper"; } }
        public override Version Version { get { return new Version(1, 0, 0); } }
        
        public override bool WantButton { get { return true; } }
        public override string ButtonText { get { return "Settings"; } }
        public override void OnButtonPress()
        {
            new SettingsForm().Show();
        }

        public static string GetItemListsPath
        {
            get
            {
                return Path.Combine(Utilities.AssemblyDirectory,
                                    string.Format("{0}", @"Plugins\LevelingHelper\ItemLists\"));
            }
        }

        public static void Log(string msg) { Logging.Write("[LevelingHelper]: " + msg); }

        public override void OnEnable()
        {
            Events.AttachEvents();
        }

        public override void OnDisable()
        {
            Events.DetachEvents();
        }

        public override void Pulse()
        {
            if (LHSettings.Instance.UseRandomBuff) { BuffHandler.CheckForRandomBuff(); }
            if (LHSettings.Instance.EnableInventoryCleanup) { InventoryHandler.CheckInventory(); }
        }

    }
}
